package team.zero.lemon.module.sys.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team.zero.lemon.common.exception.CustomException;
import team.zero.lemon.common.service.CrudService;
import team.zero.lemon.module.sys.dao.IJobDao;
import team.zero.lemon.module.sys.entity.Job;
import java.util.List;

/**
 * Created by bolin on 2016/11/7.
 */
@Service
public class JobService extends CrudService<IJobDao, Job> {
    public List<Job> findJobByUserId(int id) {
        try {
            return dao.findByUserId(id);
        } catch (Exception e) {
            throw new CustomException(e);
        }
    }
    public List<Job> findByParameter(Job role) {
        try {
            return dao.findByParameter(role);
        } catch (Exception e) {
            throw new CustomException(e);
        }
    }
    public List<Job> findJobTree( ) {
        try {
            return dao.findJobTree();
        } catch (Exception e) {
            throw new CustomException(e);
        }
    }

}